/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pmousedev.hpp - Pure virtual base class for mouse devices
//
// Copyright (c) 1997-2009 Swell Software, Inc.
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software, Inc.
// is strictly prohibited.
//
// Notes:
//
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/


#ifndef _PMOUSEDEV_HPP_
#define _PMOUSEDEV_HPP_

#ifndef PEG_MOUSE_POLL_DELAY
#define PEG_MOUSE_POLL_DELAY    5    // how long does mouse task suspend
#endif                               // between check for movement?

// Definitions for mouse button states
#ifndef PEG_MOUSE_LBUTTON
#define PEG_MOUSE_LBUTTON       1
#endif

#ifndef PEG_MOUSE_RBUTTON
#define PEG_MOUSE_RBUTTON       2
#endif
/*--------------------------------------------------------------------------*/
// Single Key Structure
/*--------------------------------------------------------------------------*/
typedef struct
{
    PEGUINT PrevButtonState;
    PEGUINT NewButtonState;
    PegPoint PrevPos;
    PegPoint NewPos;
    PEGINT MaxXPos;
    PEGINT MaxYPos;
    PEGINT MinXPos;
    PEGINT MinYPos;
} PEG_MOUSE_STATE;

#if defined(PEG_MOUSE_SUPPORT) && defined(PEG_MOUSE_INCLUDE)
/*-------------------------------------------------------------------------*/
/*-------------------------------------------------------------------------*/
class PegMouseDevice : public PegInputDevice
{
    public:
        PegMouseDevice(void);
        virtual ~PegMouseDevice();

        virtual PEGBOOL Poll(void);
        virtual void    Run(void);

    protected:
        virtual void    CheckSendMessage(void);
        virtual PEGBOOL DetectMouse(void) { return FALSE; }

        PEG_MOUSE_STATE mState;
};

/*-------------------------------------------------------------------------*/
// this function is declared here and defined in the driver source module
/*-------------------------------------------------------------------------*/
PegMouseDevice *CreatePegMouseDevice(void);

#endif  // PEG_MOUSE_SUPPORT
#endif  // _PMOUSEDEV_HPP_

